package com.seafwg.store.utils;

import java.io.Serializable;

/**
 * @Author seafwg
 * @Date 2022/3/25 4:17 下午
 * @Version 1.0
 * @description 控制层统一结果集的返回
 */

public class ResultJson<T> implements Serializable {
    private Integer status; // 状态码
    private String message; // 提示信息
    private T data; // 返回的数据使用范型便是类型

    // set/get方法：
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    // 构造方法：
    public ResultJson() {
        super();
    }

    public ResultJson(Integer status) {
        super();
        this.status = status;
    }

    public ResultJson(Integer status, T data) {
        super();
        this.status = status;
        this.data = data;
    }

    public ResultJson(Throwable e) {
        super();
        this.message = e.getMessage();
    }

}
